package com.youlai.boot.system.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.youlai.boot.system.mapper.ClimateMapper;
import com.youlai.boot.system.mapper.ConsolidationMapper;
import com.youlai.boot.system.model.QB.Consolidation;
import com.youlai.boot.system.service.ConsolidationService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.List;

@Service
public class ConsolidationServiceImpl extends ServiceImpl<ConsolidationMapper, Consolidation> implements ConsolidationService {
    private static final Logger logger = LoggerFactory.getLogger(DeviceServiceImpl.class);
    @Autowired
    private ConsolidationMapper consolidationMapper;
    @Override
    public boolean saveClimate(Consolidation consolidation) {

        consolidation.setAddtime(LocalDateTime.now());
        return save(consolidation);
    }

    @Override
    public List<Consolidation> getAllClimate() {
        return consolidationMapper.selectList(null);
    }

    @Override
    public boolean deleteClimateById(Integer id) {
        return consolidationMapper.deleteById(id) >0;
    }
}
